class TestApi {
  constructor(http, backendUrl) {
    this.http = http
    this.backendUrl = backendUrl
  }
  // 大概形式如此 返回的是promise
  getTest() {
    return this.http.get(`${this.backendUrl}/test`， {})
  }
  postTest(data ={}) {
    return this.http.post(`${this.backendUrl}/test`, data)
  }
  putTest(id, data={}) {
    return this.http.post(`${this.backendUrl}/test/${id}`, data)
  }
  deleteTest(id) {
    return this.http.delete(`${this.backendUrl}/test/${id}`)
  }
}

export default TestApi